/* 导入vue-router库中的函数 */
import {createRouter, createWebHistory} from "vue-router";

/* 定义路由变量 */
let router = createRouter({
    history: createWebHistory(),    // 路由历史
    /* 配置路由 */
    routes:[
        {
            path: '/',  // 路由路径
            component: () => import('../view/SystemUserView.vue'),
            children: [
                {
                    path: '',
                    component: () => import('../view/system/LoginView.vue'),
                    mate: { title: '登录'}
                },
                {
                    path: 'register',
                    component: () => import('../view/system/RegisterView.vue'),
                    meta: { title: '注册' }
                }
            ]
        },
        {
            path: '/main',
            component: () => import('../view/MainView.vue'),
            meta: { title: '主页面' },
            children: [
                {
                    path: '',
                    component: () => import('../view/DashboardView.vue'),
                    meta: { title: '仪表盘' }
                },
                {
                    path: 'job',
                    component: () => import('../view/quartz/JobManagerView.vue'),
                    meta: { title: '定时任务' }
                },
                {
                    path: 'dataSource',
                    component: () => import('../view/system/DataSource.vue'),
                    meta: { title: '动态数据源' }
                },
                {
                    path: 'druidMonitor',
                    component: () => import('../view/system/DruidMonitor.vue'),
                    meta: { title: 'Druid监控' }
                },
                {
                    path: 'reportConfig',
                    component: () => import('../view/report/ReportConfig.vue'),
                    meta: { title: '报表配置' }
                },
                {
                    path: 'user',
                    component: () => import('../view/UserDetail.vue'),
                    meta: { title: '用户列表' }
                },
                {
                    path: 'dict',
                    component: () => import('../view/system/DictView.vue'),
                    meta: { title: '字典管理' }
                },
                {
                    path: 'dict/:id',
                    name: 'DictDetailView',
                    component: () => import('../view/system/DictDetailView.vue'),
                    meta: { title: '字典详情' }
                },
                {
                    path: 'ai/chat',
                    component: () => import('../view/ai/ChatView.vue'),
                    meta: { title: 'AI聊天' }
                }
            ]
        }
    ]
})

/* 导出路由对象 */
export default router